package main

import (
	"github.com/gin-gonic/gin"
	"matcher/pkg/boot"
	"matcher/pkg/boot/config"
	"matcher/pkg/boot/logger"
	"matcher/pkg/core"
	"os"
	"os/signal"
	"syscall"
)

func main() {
	var app = gin.Default()
	boot.Start(app)

	go func() {
		if err := app.Run(":" + config.EnvConfig.Port); err != nil {
			logger.Fatal(err.Error())
		}
	}()

	quit := make(chan os.Signal)
	signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
	<-quit
	core.Stop()
}
